<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>vue-router</title>
</head>

<body>
    <pre>
        new Router({
            mode: 'hash',
            routes: [],
            scrollBehavior(to, from, savedPosition) {
              if (savedPosition) {
                  //返回时的数据
                return savedPosition
              } else {
                return {
                  x: 0,
                  y: 0
                }
              }
            }
    </pre>

</body>
<script>


</script>

</html>